#define _CRT_SECURE_NO_WARNINGS   1

#include<iostream>
#include<queue>
#include<vector>
using namespace std;
vector<int> head, nxt, to;
queue<int> q;
int ine[200010], topo[200010];
int cnt = 0;
void add(int u, int v){
	nxt.push_back(head[u]);
	head[u] = to.size();
	to.push_back(v);
}
int main(){
	int m, n, u, v;
	cin >> n >> m;
	head.resize(n + 5, -1);
	for (int i = 0; i<m; i++){
		cin >> u >> v;
		add(u, v);
		ine[v]++;
	}
	for (int i = 1; i <= n; i++){
		if (ine[i] == 0) q.push(i);
	}
	int k = 0;
	while (!q.empty()){
		int node = q.front();
		q.pop();
		topo[k++] = node;
		for (int i = head[node]; ~i; i = nxt[i]){
			ine[to[i]]--;
			if (ine[to[i]] == 0) q.push(to[i]);
		}
	}
	if (k != n) cout << "-1";
	else{
		for (int i = 0; i<n - 1; i++)
			cout << topo[i] << " ";
		cout << topo[n - 1];
	}
	return 0;
}